
<!--generated with sswg-->
<style>
    html {max-width: 100%; margin: auto; color: #333333;}
    a.button {padding: 15px 32px; background-color: #555; border-radius: 2em; border-width: 0px; text-decoration: none; color: white; font-size: 25.0px; line-height: 2.5em;}
    a.button:hover {background-color: #777}
    a.button_big {padding: 0.5em; background-image: linear-gradient(to top, #427b0e, #9ba97d); background-color: lightgray; background-blend-mode: multiply; border-radius: .75em; border-width: 0px; text-decoration: none; min-width: 150px; max-width: 150px; min-height: 150px; max-height: 150px; display: inline-block; vertical-align: top; margin: 4px 4px 10px 4px; color: white; font-size: 25.0px; background-size: auto 100%; background-position-x: center;}
    a.button_big:hover {background-color: white; color: #e6d23f; text-decoration: underline;}
    mark {background: #ccff99;}
    span {background-color: rgba(0, 0, 0, 0.55); padding: .1em; line-height: 1.35em;}
    img {max-width: 100%; vertical-align: top;}
    .code_block {background-color: whitesmoke; padding: 10px; margin: 0; font-family: monospace; font-size: 20; font-weight: normal; white-space: pre;}

    purple {color: hsl(289.0, 50%, 50%);}
    gray {color: gray;}
    olive {color: olive;}
    yellow {color: darkgoldenrod;}
    green {color: seagreen;}
    blue {color: hsl(210, 50%, 50%);}

</style>
<html>
<left>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>faq</title>
<br>

<div style="text-align: center;max-width: 1000px; margin: auto;font-family: arial;">
<div style="font-size: 100.0px;font-weight: bold;">
Frequently Asked Questions<br>
<div style="font-size: 20.0px;font-weight: normal;">
<br>
<br>
<div style="text-align: left;">
<br>
<b>How do I update ursina?</b><br>
<div class="code_block" style="margin-left: 1em;">pip install git+https://github.com/pokepetter/ursina.git --upgrade
</div><br>
<br>
<br>
<b>How do I move the camera?</b><br>
<br>
The camera is an Entity, so you can move and rotate it just like everything else:<br>
<div class="code_block" style="margin-left: 1em;">camera.position = Vec3(<yellow>1</yellow>,<yellow>1</yellow>,<yellow>0</yellow>)
</div><br>
<br>
<br>
<b>Why should I use Python for game development. Isn't it slow?</b><br>
<br>
Not really. The most performance critical part are written in C++ or shader code.<br>
Python can make you more productive as a developer and thus make it easier<br>
to structure your project in a good way, rather than micro-optimize.<br>
<br>
<br>
<br>
<br>
<b>How do I call a function with a delay?</b><br>
<br>
<div class="code_block" style="margin-left: 1em;">invoke(some_function, arg<yellow>1</yellow>, kwarg<yellow>1</yellow>=<green>'some kwarg'</green>, dela<olive>y</olive>=<yellow>2</yellow>)
</div><br>
<br>
<br>
<br>
<b>How do I make pixel art not blurry?</b><br>
<br>
<div class="code_block" style="margin-left: 1em;">Texture.default_filtering = None
</div><br>
or for a single texture:<br>
<div class="code_block" style="margin-left: 1em;">some_texture.filtering = None
</div><br>
<br>
<br>
<br>
<b>How do I add lights?</b><br>
<br>
If all you want are some simple lights to make 3D shapes look more interesting,<br>
look at the program 'lights.py' in the samples folder.&nbsp;&nbsp;For anything more complicated,<br>
you are on your own.<br>
<br>
<br>
<br>
<br>
<b>How can I use panda3d alongside ursina?</b><br>
<br>
What you need to know is that Entity is a NodePath and Ursina is a ShowBase.<br>
You can also write custom shaders, see panda3d's shader documentation for that.<br>
<br>
<br>
<br>
<br>
<b>How do I detect collisions?</b><br>
<br>
One way is with raycasts. They can hit anything with a collider.<br>
<br>
<a href="https://www.ursinaengine.org/cheat_sheet.html#raycaster">https://www.ursinaengine.org/cheat_sheet.html#raycaster</a><br>
<a href="https://www.ursinaengine.org/cheat_sheet.html#HitInfo">https://www.ursinaengine.org/cheat_sheet.html#HitInfo</a><br>
<a href="https://www.ursinaengine.org/cheat_sheet.html#Collider">https://www.ursinaengine.org/cheat_sheet.html#Collider</a><br>
<br>
There's also intersects(), which use the entity's collider and check if it intersects other colliders.<br>
Like raycast(), it also returns a HitInfo.<br>
<br>
<br>
<br>
Here's an example from the FirstPersonController:<br>
<br>
<div class="code_block" style="margin-left: 1em;"><gray># cast a ray <purple>from</purple> the player position in the walk direction.</gray>
<gray># only move forward <purple>if</purple> it doesn't hit anything.</gray>
origin = self.world_position + (self.up*.<yellow>5</yellow>) + (self.direction/<yellow>2</yellow>)
ray = raycast(origin , self.direction, <olive>ignore</olive>=[self,], distance=.<yellow>2</yellow><yellow>5</yellow>, debug=False)

<purple>if</purple> <purple>not</purple> ray.hit:
   self.position += self.direction * self.speed * time.dt

</div><br>

</html>